home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / creatf.arc / FILES.ASM next >
Assembly Source File  |  1987-12-15  |  719b  |  45 lines

  1.       name    Create_A_File
  2.  
  3. CGroup    group    Code
  4.     assume    cs: CGroup, ds: CGroup
  5.  
  6. Code    segment 'CODE'
  7.     jmp    Main
  8.  
  9. File        db    'TEST.TXT',0
  10. HandleMsg    db    'Handle is: $'
  11. LineFeed    db    0Ah, 0Dh,'$'
  12.  
  13. Main    proc    near
  14.     mov    ax, cs
  15.     mov    ds, ax
  16.     ;DOS requires 3Ch in AH for create and attribute in CX
  17.     ;  80h is shareable read/write
  18.     mov    dx, offset CGroup: File
  19.     mov     ax, 3C00h
  20.     mov    cx, 0080h
  21.     int    21h
  22.     push    ax
  23.     ;Print out the file handle
  24.     mov    dx, offset CGroup: HandleMsg
  25.     mov    ah, 09h
  26.     int    21h
  27.     pop    ax
  28.     xor    ah, ah
  29.     mov    dl, al
  30.     add    dl, 48
  31.     mov    ah, 02h
  32.     int    21h
  33.     mov    dx, offset CGroup: LineFeed
  34.     mov    ah, 09h
  35.     int    21h
  36.     ;Terminate this DOS process
  37.     mov    ax, 4C01h
  38.     int    21h
  39.     ret
  40. Main    endp
  41.  
  42. Code    ends
  43.     end
  44.  
  45.